home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / GameKit / Examples / NX_Invaders / AnimTester / PreferencesBrain.h < prev    next >
Encoding:
Text File  |  1995-06-12  |  2.9 KB  |  76 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. // This object is the central clearing house for the preferences.  It
  5. // handles I/O between the Preferences Panel controls and it stores stuff
  6. // in the defaults database.  It also tells the app when things change.
  7. // The app can also query it to find the state of various preferences.
  8.  
  9. #import <objc/Object.h>     /* superclass */
  10. #import <appkit/appkit.h>     /* matrix controls' methods */
  11. #import <stdio.h>        /* strcpy */
  12. #import <stdlib.h>        /* malloc */
  13. #import "GameBrain.h"        /* where to send change alerts */
  14.  
  15.  
  16. @interface PreferencesBrain:Object
  17. {    
  18.     // various controls on the Preferences... Panel
  19.     id    speedButtons;        // buttons to set game speed on pref panel
  20.     id    preferencesPanel;    // preferences panel instance
  21.     id    musicButtons;        // radio buttons for music on/off
  22.     id    effectButtons;        // radio buttons for sound effects on/off
  23.     id  demoSwitch;            // "Demo Sound" switch
  24.     id  alertSwitch;        // "Alerts" switch
  25.     id  autoUnPauseSwitch;    // "Auto Unpause" switch
  26.     id  autoStartSwitch;    // "New Game on Launch" switch
  27.  
  28.     id  gameScreen;            // GameView instance/subclass
  29.     id  gameBrain;            // GameBrain instance
  30.     
  31.     // instance variables to hold preferences and game status:
  32.     int speed;
  33.     BOOL music, effects, alert, demoSound, autoUnPause, autoStart;
  34.     char *defaultPlayerName, *version;    // used for internal purposes.
  35. }
  36.  
  37. - init;                    // designated initializer
  38.  
  39. // methods called by the app to access the various preferences
  40. - (BOOL)firstTimeCheck;    // first time running this version?
  41. - preferencesPanel;        // returns the id of the Preferences Panel
  42. - (int)speed;            // return game speed
  43. - (BOOL)music;            // return music status
  44. - (BOOL)effects;        // return effects status
  45. - setDefaultPlayerName:(char *)aString;    // change default player name
  46. - (const char *)defaultPlayerName;  // return ptr to defaultPlayerName string
  47. - revert:sender;        // return to default values
  48. - setAutoUnPause:(BOOL)al;
  49. - (BOOL)autoUnPause;
  50. - (BOOL)alert;
  51. - (BOOL)demoSound;
  52. - (BOOL)autoStart;
  53. - setAutoStart:(BOOL)al;
  54. - setAlert:(BOOL)al;
  55.  
  56.     
  57. // Interface Builder (IB) methods:
  58. //    (called by various controls on the Preferences Panel)
  59. - readDefaults:sender;        // read preferences from defaults database
  60. - writeDefaults:sender;        // write preferences to defaults database
  61. - speedChange:sender;        // target of speed pref. matrix
  62. - preferences:sender;        // called by Preferences... menu item
  63. - musicChange:sender;        // target of music on/off matrix on pref panel
  64. - effectsChange:sender;        // target of effect on/off matr. on pref panel
  65. - alertChange:sender;        // turn alert panels on/off
  66. - autoStartChange:sender;    // auto start game on launch on/off
  67. - demoSoundChange:sender;    // turn off sound only in demo
  68. - setBack:sender;            // set the background image
  69. - revertBack:sender;        // revert to default background image
  70. - back1:sender;                // call up background #1
  71. - back2:sender;                // call up background #1
  72. - back3:sender;                // call up background #1
  73. - unPauseChange:sender;        // turn off auto un-pausing
  74.  
  75. @end
  76.